import React from "react"
class Todo extends React.Component {
    ref=React.createRef()
    state = {
        arr: ["吃饭", "睡觉", "打王者", "看电影", "压马路", "蹦迪", "打太极", "跑步", "健身房"],
        newarr:[]
    }
    click=(e)=>{
        console.log(e)
// this.setState({
//     newarr:newarr.push()
// })
    }

    render() {
        let s1=this.state.arr.map((item,index)=><p key={index} ><button onClick={this.click} ref={this.ref}>点击</button>{item} <button>删除</button></p>)
        // let s2=this.state.arr.filter((it,i)=>)
        return (
            <fieldset>
                <legend>todoList</legend>
                <h1>todoList <input type="search" /></h1>
                <div><h1>正在进行</h1>
                   {s1}
                </div>
                <div><h1>已经完成</h1>
                  
                </div>
            </fieldset>
        )
    }
}
export default Todo